package com.accenture.portal.service.impl.role;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.accenture.portal.dao.role.RoleMapper;
import com.accenture.portal.model.access.Access;
import com.accenture.portal.model.role.Role;
import com.accenture.portal.service.role.RoleService;
@Service
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleMapper roleMapper;
	
	public List<Role> listAllRoles() {
		return roleMapper.listAllRoles();
	}

	public void insertRole(Role role) {
		roleMapper.insertRole(role);
	}

	public void updateRoleBaseInfo(Role role) {
		roleMapper.updateRoleBaseInfo(role);
	}
	
	public RoleMapper getRoleMapper() {
		return roleMapper;
	}

	public void setRoleMapper(RoleMapper roleMapper) {
		this.roleMapper = roleMapper;
	}
	@Override
	public int totalCount() {
		return roleMapper.totalCount();
	}

	@Override
	public List<Role> Page(int start, int end) {
		return roleMapper.Page(start, end);
	}
	@Override
	public List<Access> allAccess() {
		return roleMapper.allAccess();
	}
	@Override
	public void logicalDeleteRole(int roleId) {
		roleMapper.logicalDeleteRole(roleId);
		
	}

	@Override
	public Role getRoleById(Integer roleId) {
		return roleMapper.getRoleById(roleId);
	}
}
